<!--
 * @Author: zk
 * @Date: 2021-01-20 16:43:29
 * @LastEditors: zk
 * @LastEditTime: 2021-01-22 09:38:27
 * @Description:
-->
<template>
  <el-row :gutter="15">
    <el-col :span="10">
      <!-- 是否体检 -->
      <el-select
        v-model="model.isCheck"
        placeholder="请选择"
        :style="{ width: '100%' }"
        @change="SelectValue($event)"
      >
        <el-option
          v-for="op in isCheckOption"
          :key="op.value"
          :label="op.label"
          :value="op.value"
        />
      </el-select>
    </el-col>
    <el-col :span="10">
      <el-select
        v-model="model.examine"
        placeholder="请选择"
        :disabled="examineD"
        :style="{ width: '100%' }"
        @change="SelectYearValue($event)"
      >
        <el-option
          v-for="op in examineOption"
          :key="op.value"
          :label="op.label"
          :value="op.value"
        />
      </el-select>
    </el-col>
  </el-row>
</template>

<script>
// 加载模拟数据
import { checkType, examineType } from '@/simdata/healthData.js'
export default {
  name: 'PhysicalExamination',
  props: {
    model: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      // timeModel: {
      //   isCheck: "", // 是否体检
      //   examine: "" // 审核状态
      // },
      isCheckOption: checkType,
      examineOption: examineType,
      examineD: true
    }
  },
  methods: {
    SelectValue(val) {
      console.log(val)
      if (val == '3') {
        this.examineD = false
      } else if (val == '2') {
        this.examineD = true
        this.model.examine = ''
      } else if (val == '1') {
        this.examineD = true
        this.model.examine = ''
      }
      this.model.isCheck = val
    },
    SelectYearValue(val) {
      console.log(val)
      this.model.examine = val
    }
  }
}
</script>

<style lang="scss" scoped></style>
